Change in openvpn[master]: dco: don't use NetLink to exchange control packets
A message that is not in the archive (sent off-list or not yet received): gerrit.1677068512000.Ia1297c3ae9a28b188ed21ad21ae96fff3d02ee4d@...2715...
Attention is currently required from: cron2, ordex.
plaisthos has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/28?usp=email )
Change subject: dco: don't use NetLink to exchange control packets
......................................................................
Patch Set 4:
(5 comments)
File src/openvpn/forward.c:
http://gerrit.openvpn.net/c/openvpn/+/28/comment/79ae6092_3d114668
PS4, Line 1702: */
Maybe move that comment (the part that still applies) to the new socket_is_dco_win method?
File src/openvpn/ovpn_dco_linux.h:
http://gerrit.openvpn.net/c/openvpn/+/28/comment/7e5b2aa7_22504803
PS4, Line 30: OVPN_CMD_NEW_PEER,
Didn't you want to add a length field for the residual TCP buffer and just 0 here to avoid another API revision?
File src/openvpn/socket.h:
http://gerrit.openvpn.net/c/openvpn/+/28/comment/4472fe5d_39cf056b
PS4, Line 1184: /* unified UDPv4 and UDPv6 and DCO (kernel adds size header) */
But here we remove the comment, even though it is also true here.
http://gerrit.openvpn.net/c/openvpn/+/28/comment/f0531361_fcbd90ef
PS4, Line 209: #define SF_DCO_WIN (1<<5)
Is using a flag really better than a bool here?
http://gerrit.openvpn.net/c/openvpn/+/28/comment/b7557dab_78851b42
PS4, Line 1069: * will strip the length header */
here the comment is kept (since it is still true)
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/28?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia1297c3ae9a28b188ed21ad21ae96fff3d02ee4d
Gerrit-Change-Number: 28
Gerrit-PatchSet: 4
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: cron2
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: stipa <[email protected]...>
Gerrit-Attention: cron2
Gerrit-Attention: ordex <[email protected]...>
Gerrit-Comment-Date: Thu, 09 Mar 2023 14:04:30 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: cron2, ordex.
ordex has uploaded this change for review. ( http://gerrit.openvpn.net/c/openvpn/+/28?usp=email )
Change subject: dco: don't use NetLink to exchange control packets
......................................................................
dco: don't use NetLink to exchange control packets
Using NetLink has proved to be overkill and performance critical. The amount of control traffic can also easily overrun the NetLink buffer when a server has enough clients connected.
Stop using NetLink to send/receive control packets and just use the transport socket as if DCO was not there at all.
Under the hood DCO will redirect control packets to the transport socket without altering them, so that userspace can happily process them as usual.
---
M src/openvpn/dco.c
M src/openvpn/dco.h
M src/openvpn/dco_freebsd.c
M src/openvpn/dco_freebsd.h
M src/openvpn/dco_linux.c
M src/openvpn/dco_linux.h
M src/openvpn/dco_win.c
M src/openvpn/forward.c
M src/openvpn/init.c
M src/openvpn/mtcp.c
M src/openvpn/multi.c
M src/openvpn/ovpn_dco_linux.h
M src/openvpn/socket.c
M src/openvpn/socket.h
14 files changed, 52 insertions(+), 296 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/28/28/4
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/28?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia1297c3ae9a28b188ed21ad21ae96fff3d02ee4d
Gerrit-Change-Number: 28
Gerrit-PatchSet: 4
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: cron2
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: stipa <[email protected]...>
Gerrit-Attention: cron2
Gerrit-Attention: ordex <[email protected]...>
Gerrit-MessageType: newchange
Attention is currently required from: cron2, plaisthos.
ordex has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/28?usp=email )
Change subject: dco: don't use NetLink to exchange control packets
......................................................................
Patch Set 4:
(5 comments)
File src/openvpn/forward.c:
http://gerrit.openvpn.net/c/openvpn/+/28/comment/edcaa03e_7d307609
PS4, Line 1702: */
Quoted 1 line
Maybe move that comment (the part that still applies) to the new
socket_is_dco_winmethod?
hmm I'd add a different working because it is not about where to send control packets, but just checking if DCO is enabled on a link or not. but yeah, we could definitely add some doc to socket_is_dco_win
File src/openvpn/ovpn_dco_linux.h:
http://gerrit.openvpn.net/c/openvpn/+/28/comment/be25a0d8_f403b236
PS4, Line 30: OVPN_CMD_NEW_PEER,
Quoted 1 line
Didn't you want to add a length field for the residual TCP buffer and just 0 here to avoid another A […]
nah, adding a field does not break the API. We can add it later as it fixes a separate issue.
File src/openvpn/socket.h:
http://gerrit.openvpn.net/c/openvpn/+/28/comment/fdce9d57_fe86f5e0
PS4, Line 1184: /* unified UDPv4 and UDPv6 and DCO (kernel adds size header) */
Quoted 1 line
But here we remove the comment, even though it is also true here.
again, why do we talk about size header if this is UDP?
http://gerrit.openvpn.net/c/openvpn/+/28/comment/af827c3f_5e4fc158
PS4, Line 209: #define SF_DCO_WIN (1<<5)
Quoted 1 line
Is using a flag really better than a bool here?
this is Lev's doing :-D
Technically we already have the socketflags bitfield, so re-using it is not a bad idea and it is less invasive compared to adding a member that is used by one platform only.
http://gerrit.openvpn.net/c/openvpn/+/28/comment/c793d3d9_3d0bef67
PS4, Line 1069: * will strip the length header */
Quoted 1 line
here the comment is kept (since it is still true)
I am confused. this is UDP, how come we talk about length header?
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/28?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia1297c3ae9a28b188ed21ad21ae96fff3d02ee4d
Gerrit-Change-Number: 28
Gerrit-PatchSet: 4
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: cron2
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: stipa <[email protected]...>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: cron2
Gerrit-Comment-Date: Thu, 09 Mar 2023 14:21:34 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: plaisthos <[email protected]...>
Gerrit-MessageType: comment
Attention is currently required from: cron2, ordex.
plaisthos has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/28?usp=email )
Change subject: dco: don't use NetLink to exchange control packets
......................................................................
Patch Set 4:
(5 comments)
File src/openvpn/forward.c:
http://gerrit.openvpn.net/c/openvpn/+/28/comment/247c9792_e7b2c3b6
PS4, Line 1702: */
Quoted 1 line
hmm I'd add a different working because it is not about where to send control packets, but just chec […]
Ack
File src/openvpn/ovpn_dco_linux.h:
http://gerrit.openvpn.net/c/openvpn/+/28/comment/9b1a1741_9fe75f0a
PS4, Line 30: OVPN_CMD_NEW_PEER,
Quoted 1 line
nah, adding a field does not break the API. We can add it later as it fixes a separate issue.
Ack
File src/openvpn/socket.h:
http://gerrit.openvpn.net/c/openvpn/+/28/comment/f7ee8257_3b07557c
PS4, Line 1184: /* unified UDPv4 and UDPv6 and DCO (kernel adds size header) */
Quoted 1 line
again, why do we talk about size header if this is UDP?
when we have TCP we need to add the size header but in the DCO case, the kernel does that for us.
http://gerrit.openvpn.net/c/openvpn/+/28/comment/97dc5bba_a14de127
PS4, Line 209: #define SF_DCO_WIN (1<<5)
Quoted 1 line
this is Lev's doing :-D […]
Ack
http://gerrit.openvpn.net/c/openvpn/+/28/comment/3f58627e_3e6501af
PS4, Line 1069: * will strip the length header */
Quoted 1 line
I am confused. […]
Basically in this codepath it is basically more like read_packet_with_header vs read_packet_without_header but we call them udp and tcp here. And therefore use the udp path even for tcp when dco is enabled since that header is already removed.
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/28?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia1297c3ae9a28b188ed21ad21ae96fff3d02ee4d
Gerrit-Change-Number: 28
Gerrit-PatchSet: 4
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: cron2
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: stipa <[email protected]...>
Gerrit-Attention: cron2
Gerrit-Attention: ordex <[email protected]...>
Gerrit-Comment-Date: Thu, 09 Mar 2023 14:32:02 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: plaisthos <[email protected]...>
Comment-In-Reply-To: ordex <[email protected]...>
Gerrit-MessageType: comment
Attention is currently required from: cron2, plaisthos.
ordex has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/28?usp=email )
Change subject: dco: don't use NetLink to exchange control packets
......................................................................
Patch Set 4:
(2 comments)
File src/openvpn/socket.h:
http://gerrit.openvpn.net/c/openvpn/+/28/comment/6956503d_6dfb58db
PS4, Line 1184: /* unified UDPv4 and UDPv6 and DCO (kernel adds size header) */
Quoted 1 line
when we have TCP we need to add the size header but in the DCO case, the kernel does that for us.
not anymore on linux as packets are just left untouched.
http://gerrit.openvpn.net/c/openvpn/+/28/comment/f80fb018_e8c00ace
PS4, Line 1069: * will strip the length header */
Quoted 1 line
Basically in this codepath it is basically more like
read_packet_with_headervsread_packet_without_[…]
aaah makes sense now. However, now the length header has to be set/unset by userland, because control packets are left untouched by DCO-linux
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/28?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia1297c3ae9a28b188ed21ad21ae96fff3d02ee4d
Gerrit-Change-Number: 28
Gerrit-PatchSet: 4
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: cron2
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: stipa <[email protected]...>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: cron2
Gerrit-Comment-Date: Thu, 09 Mar 2023 14:37:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: plaisthos <[email protected]...>
Comment-In-Reply-To: ordex <[email protected]...>
Gerrit-MessageType: comment
Attention is currently required from: cron2, plaisthos.
Hello cron2, plaisthos,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/28?usp=email
to look at the new patch set (#5).
Change subject: dco: don't use NetLink to exchange control packets
......................................................................
dco: don't use NetLink to exchange control packets
Using NetLink has proved to be overkill and performance critical. The amount of control traffic can also easily overrun the NetLink buffer when a server has enough clients connected.
Stop using NetLink to send/receive control packets and just use the transport socket as if DCO was not there at all.
Under the hood DCO will redirect control packets to the transport socket without altering them, so that userspace can happily process them as usual.
---
M src/openvpn/dco.c
M src/openvpn/dco.h
M src/openvpn/dco_freebsd.c
M src/openvpn/dco_freebsd.h
M src/openvpn/dco_linux.c
M src/openvpn/dco_linux.h
M src/openvpn/dco_win.c
M src/openvpn/forward.c
M src/openvpn/init.c
M src/openvpn/mtcp.c
M src/openvpn/multi.c
M src/openvpn/ovpn_dco_linux.h
M src/openvpn/socket.c
M src/openvpn/socket.h
14 files changed, 58 insertions(+), 297 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/28/28/5
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/28?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia1297c3ae9a28b188ed21ad21ae96fff3d02ee4d
Gerrit-Change-Number: 28
Gerrit-PatchSet: 5
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: cron2
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: stipa <[email protected]...>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: cron2
Gerrit-MessageType: newpatchset
Attention is currently required from: cron2, plaisthos.
ordex has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/28?usp=email )
Change subject: dco: don't use NetLink to exchange control packets
......................................................................
Patch Set 5:
(2 comments)
File src/openvpn/socket.h:
http://gerrit.openvpn.net/c/openvpn/+/28/comment/1357b934_a0d12dbd
PS4, Line 1184: /* unified UDPv4 and UDPv6 and DCO (kernel adds size header) */
Quoted 1 line
not anymore on linux as packets are just left untouched.
Ack
http://gerrit.openvpn.net/c/openvpn/+/28/comment/757247af_5fb67f04
PS4, Line 1069: * will strip the length header */
Quoted 1 line
aaah makes sense now. […]
Ack
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/28?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia1297c3ae9a28b188ed21ad21ae96fff3d02ee4d
Gerrit-Change-Number: 28
Gerrit-PatchSet: 5
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: cron2
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: stipa <[email protected]...>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: cron2
Gerrit-Comment-Date: Thu, 09 Mar 2023 15:02:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: plaisthos <[email protected]...>
Comment-In-Reply-To: ordex <[email protected]...>
Gerrit-MessageType: comment
Attention is currently required from: cron2, ordex.
plaisthos has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/28?usp=email )
Change subject: dco: don't use NetLink to exchange control packets
......................................................................
Patch Set 5: Code-Review+1
(1 comment)
Patchset:
PS5:
something nice
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/28?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia1297c3ae9a28b188ed21ad21ae96fff3d02ee4d
Gerrit-Change-Number: 28
Gerrit-PatchSet: 5
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: cron2
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: stipa <[email protected]...>
Gerrit-Attention: cron2
Gerrit-Attention: ordex <[email protected]...>
Gerrit-Comment-Date: Thu, 09 Mar 2023 15:30:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: cron2, ordex.
plaisthos has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/28?usp=email )
Change subject: dco: don't use NetLink to exchange control packets
......................................................................
Patch Set 5: Code-Review+2
(1 comment)
Patchset:
PS5:
now with even more nice approval.
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/28?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia1297c3ae9a28b188ed21ad21ae96fff3d02ee4d
Gerrit-Change-Number: 28
Gerrit-PatchSet: 5
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: cron2
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: stipa <[email protected]...>
Gerrit-Attention: cron2
Gerrit-Attention: ordex <[email protected]...>
Gerrit-Comment-Date: Thu, 09 Mar 2023 15:54:14 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
plaisthos (Code Review)
Acked-by Arne Schwabeplaisthos has uploaded a new patch set (#6) to the change originally created by ordex. ( http://gerrit.openvpn.net/c/openvpn/+/28?usp=email )
The following approvals got outdated and were removed:
Code-Review+2 by plaisthos
Change subject: dco: don't use NetLink to exchange control packets
......................................................................
dco: don't use NetLink to exchange control packets
Using NetLink for control messages did not work out as it did lead to kernel side buffer congestion during heavy client activity.
With this patch DCO will redirect control packets directly to the transport socket without altering them, so that userspace can happily process them as usual.
NOTE: this is an API breaking change. Up to this commit, the userland requests a kernel module called "ovpn-dco" which does control messages via netlink. From this commit on, OpenVPN requests a kernel module named "ovpn-dco-v2" which brings the kernel change corresponding to this commit.
If the system only has "the wrong module" available (either way), OpenVPN will log
... Kernel support for ovpn-dco missing, disabling data channel offload.
and proceed without kernel support.
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg26384.html
---
M src/openvpn/dco.c
M src/openvpn/dco.h
M src/openvpn/dco_freebsd.c
M src/openvpn/dco_freebsd.h
M src/openvpn/dco_linux.c
M src/openvpn/dco_linux.h
M src/openvpn/dco_win.c
M src/openvpn/forward.c
M src/openvpn/init.c
M src/openvpn/mtcp.c
M src/openvpn/multi.c
M src/openvpn/ovpn_dco_linux.h
M src/openvpn/socket.c
M src/openvpn/socket.h
14 files changed, 70 insertions(+), 297 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/28/28/6
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/28?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia1297c3ae9a28b188ed21ad21ae96fff3d02ee4d
Gerrit-Change-Number: 28
Gerrit-PatchSet: 6
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: cron2
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: stipa <[email protected]...>
Gerrit-MessageType: newpatchset
plaisthos (Code Review)
Acked-by Arne Schwabeplaisthos has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/28?usp=email )
Change subject: dco: don't use NetLink to exchange control packets
......................................................................
dco: don't use NetLink to exchange control packets
Using NetLink for control messages did not work out as it did lead to kernel side buffer congestion during heavy client activity.
With this patch DCO will redirect control packets directly to the transport socket without altering them, so that userspace can happily process them as usual.
NOTE: this is an API breaking change. Up to this commit, the userland requests a kernel module called "ovpn-dco" which does control messages via netlink. From this commit on, OpenVPN requests a kernel module named "ovpn-dco-v2" which brings the kernel change corresponding to this commit.
If the system only has "the wrong module" available (either way), OpenVPN will log
... Kernel support for ovpn-dco missing, disabling data channel offload.
and proceed without kernel support.
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg26384.html
---
M src/openvpn/dco.c
M src/openvpn/dco.h
M src/openvpn/dco_freebsd.c
M src/openvpn/dco_freebsd.h
M src/openvpn/dco_linux.c
M src/openvpn/dco_linux.h
M src/openvpn/dco_win.c
M src/openvpn/forward.c
M src/openvpn/init.c
M src/openvpn/mtcp.c
M src/openvpn/multi.c
M src/openvpn/ovpn_dco_linux.h
M src/openvpn/socket.c
M src/openvpn/socket.h
14 files changed, 70 insertions(+), 297 deletions(-)
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/28?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia1297c3ae9a28b188ed21ad21ae96fff3d02ee4d
Gerrit-Change-Number: 28
Gerrit-PatchSet: 6
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: cron2
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: stipa <[email protected]...>
Gerrit-MessageType: merged